<?php
namespace app\examScore\controller;
use app\common\Base;
use think\Db;
//--优异奖配置
class YouyiPrizeConf extends Base {
	
	public function index() {
		return $this->fetch();
	}

	public function pageQuery() {
		$result = Db::table("优异奖设置")
				->select();
		$grid['rows'] = selectResult($result);
		$grid['total'] = count($result);
		return $grid;
	}
	
	public function addUpdate() {
		$all = request()->param();
		try {
			if(array_key_exists("ID", $all)) {
				update('优异奖设置', $all);
			} else {
				insert('优异奖设置', $all);
			}
			return "000";
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		return "999";
	}

	public function del() {
		$delIds = input("delIds");
		try {
			Db::name('优异奖设置')->where('ID','in',explode(",", $delIds))->delete();
			return "000";
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		return "999";
	}

}
